Computer image color correction is an image processing employed for eliminating a difference in output features for the same image between different output devices (such as a display screen and a printer). The core technology of computer image color correction is to achieve a consistent output (color) effect which closes to a manuscript as much as possible. The difference in output features between different output devices results in colors output by different output devices belonging to different color spaces. In fact, a process of color correction is mainly a process of transforming an image in one color space (a color space of the manuscript, original color space) into another color space. Features of different color spaces are generally described with industrial standards specified by International Color Consortium (ICC), which are referred to as ICC Profile.
In general, the process of color correction for an output device is shown in FIG. 1, comprising the following steps:
Step 1, Color Adjustment
This step is provided mainly for compensating a difference between the original color space and an ICC profile describing the original color space. Of course, in practice, this step may also be used for compensating a difference between a color space of a device and an ICC profile describing the color space of the device, or for simply making a certain special processing for an image, for example, increasing Magenta component among Cyan (C), Magenta (M), Yellow (Y), and Black (K) components of the whole image.
Step 2, Color Space Transformation
This step is a core step of the whole process of color correction, and it needs to transform an image in the original color space into an image with the same or a similar visual effect under the color space of the device pixel by pixel in accordance with features of the original color space and the color space of the device. See the following representation of pseudo codes:
Res = ICC_Convert([in]srcICC, [in]desICC, [in]src, [out]des, [in]num)// ICC_Convert is a function for color space transformation// Res represents a result of the transformation process, forexample, succeed or fail// srcICC represents an ICC profile describing the original colorspace// desICC represents an ICC profile describing the color space ofthe device// src is a pointer pointing to a data buffer of an image undersrcICC color space// des is used for output, and is a pointer pointing to a buffer of thetransformed image// num represents the number of pixels which needs transforming
Sometimes in order to speed up, srcICC and desICC may be combined as one file to guide the transformation process of two color spaces, and the combined file is referred to as DeviceLink. By using DeviceLink, above pseudo codes become:
Res=ICC_Convert([in]src_des_Link, [in]src, [out]des, [in]num);
Wherein, src_des_Link represents DeviceLink from the original color space to the color space of the device.
Step 3, “Black”/“Gray”/“Solid Color” Sets Reservation
Under CMYK color space, “black” has two kinds of definitions:
a) a value of black component is 100% and other color component values are 0, that is, k=100%=1, c=0, m=0 and y=0; or
b) the value of black component being 100% is enough, that is, k=100%.
“Black” reservation means that if a color value of a certain pixel of an original image satisfies the above definitions of black, regardless of what the color value becomes after the color space transformation, the value returns to a standard black value (c=0, m=0, y=0 and k=1).
Under CMYK color space, a definition of “gray” is that except k color component, other color components are equal and they are 0, that is, c=m=y=0.
“Gray” reservation means that if a color value of a certain pixel of an original image satisfies the above definition of gray, regardless of what the color value becomes after the color space transformation, the value returns to the color value before the color space transformation.
Under CMYK color space, a definition of “solid color” is that except one color component, other color components are all 0.
“Solid color” reservation means that if a color value of a certain pixel of an original image satisfies the above definition of solid color, regardless of what the color value becomes after the color space transformation, the value returns to the color value before the color space transformation.
Such a step exists in the process of color correction for two main reasons: a) Regardless of “black”, “gray” or “solid color”, there may be a situation that color component values are not 0 after performing the color space transformation, resulting in “degradation” visually.
b) A function of color space transformation generally does not have such a function, so it needs correcting the color values of pixels which should not be transformed after the image is transformed.
Step 4, Total Volume of Ink Controlling
Different kinds of paper are very different in absorbency of different kinds of ink. If the sum of various color component values is over huge at one position (pixel), the volume of ink will exceed the absorbency of the paper, resulting in flow or that the ink can not be attached to an output medium, and the output effect of the whole image is damaged finally.
Total volume of ink controlling is a method applied for reducing various color component values when the sum of various color component values of a certain pixel exceeds a certain threshold. A function of total volume of ink controlling will be explained in a method of proportionally reducing various color component values as follows:
// first, calculating the total volume of inksum = c + m + y + k ;if (sum > Threshold){// if the total volume of ink exceeds the threshold, reducingvarious color component values proportionallyc = c * Threshold / sum;m = m * Threshold / sum;y = y * Threshold / sum;k = k * Threshold / sum;}
It should be noted that the method of reducing various color component values proportionally is only one of the methods for total volume of ink controlling.
Step 5, Linearization
In general, most of output devices can not accurately represent input color values. For example, when a Color Inkjet Printer printing a color block of 50% solid cyan color (the color values are c=0.5, m=0, y=0 and k=0), an actual output measuring value of cyan is generally 70% or higher. In this case, in order to achieve 50% output value of cyan, the input cyan needs adjusting.
For example, the output effect of 50% input value is 70%; in order to achieve 50% output effect, the input value is changed into 33%.
Step 6, Dithering.
Sometimes there is an area where a color is uniformly transited into another color in an image. Actually, it is a teeny and regular change in color values between adjacent pixels in a certain direction.
However, due to the aforementioned processing steps, the uniformity of color transition will be damaged. At this time, during the process of color gradually transiting, a relatively huge change in color values between adjacent pixels will occur, resulting in “degradation” visually.
Dithering is used for getting rid of the bad visual effect, and the method used is obscuring a boundary where a sudden change occurs.
As total volume of ink controlling, there are many methods for dithering. One of the methods and its function will be illustrated as follows:
// sizeofImage represents the number of image pixelsfor ( int i = 0; i < sizeofImage; i++){// image represents image data including four components:// CMYK. A range of each component is 0-255.// DT represents dithering table, each value of the table also// includes four components, and a range of each// component is also 0-255.// sizeofDT represents a size of the dithering table, in order to// avoid repetition at utmost, sizeofDT is a prime in general.if (image[i].c > 0 && image[i].c < 255)// % represents an operation of congruenceimage[i].c += image[i].c > DT[i%sizeofDT].c;if (image[i].m > 0 && image[i].m < 255)image[i].m += image[i].m > DT[i%sizeofDT].m;if (image[i].y > 0 && image[i].y <255)image[i].y += image[i].y > DT[i%sizeofDT].y;if (image[i].k > 0 && image[i].k < 255)image[i].k += image[i].k > DT[i%sizeofDT].k;}
It can be seen from the above method, by way of randomly increasing or decreasing the values of various components of each pixel of the input image, an effect of obscuring a boundary where the sudden change occurs can be achieved.
While only six steps in the process of computer image color correction are listed above, there may be more steps in practice, and an order of steps in the process is not fixed.
It can be seen from the above steps in the process of color correction, a common method of color correction needs to take multiple steps and a pixel-by-pixel process to the original image, and the amount of computation is very huge. Especially when an input image having a high resolution and a large size, the processing speed becomes a huge bottleneck, and a demand for high-speed output devices can not be met.